package com.zhou.javase.ch03;

import org.omg.CORBA.PUBLIC_MEMBER;

/**
 * 类的应用：构造对象完成任务；
 * @author lenovo
 *
 */
public class PersonTest {
	
	public static void main(String[] args) {
		Person person = new Person();
		/*所有的打印输出前加上字符串描述 后跟答案显示；
		 * 
		 * */
		System.out.println("person.getInfo()=="+person.getInfo());
		
		person.setName("hehe");
		String str = person.getInfo();
		System.out.println("str:"+str);
		/**
		 * 测试加法运算重载的运用--------------开始
		 */
		int x = 19 ;
		int y = 12;
		person.add(x, y);
		
		double xd = 10.2 ; 
		double yd = 20.3 ; 
		person.add(xd, yd);
		
		int x1 = 19 ;
		int y1 = 12;
		int z = 14 ;
		person.add(x1, y1, z);
		/**
		 * 测试加法运算重载的运用--------------end
		 */
		
		/**
		 * 测试减法运算重载的运用--------------开始
		 */
		/* 19 - 11 - 5 = */
		int a = 19 ;
		int b = 11 ;
		int c = person.sub(a, b);
		System.out.println(a+"-"+b+"=" + c );
		
		int d = 5;
		int e = person.sub(c, d);
		System.out.println( "e =" + e );
		/**
		 * 测试减法运算重载的运用--------------end 
		 */
		
		Person p1 = new Person(23,"sisi");
		String str1 = p1.getInfo();
		System.out.println("str1:" + str1);
		/**
		 * 静态方法调用不用new 对象，直接类名。方法()；
		 */
		int re = Person.addStatic(x1, y1);
		System.out.println("re = " +  re);
		person.addStatic(x1, y1);
		
	}
}
